
import { Button } from 'antd';
import React,{useRef} from 'react'
import SonA from './SonA'

export default function Parent() {
  
  const refSon = useRef();  
  
  const refInput = useRef(null);

  function fn(){
    console.log("refSon.current",refSon.current);
    console.log("refInput",refInput);
  }

  return (
    <>
    <div>useRefDemo02</div>
    <input type="button" value="测试" onClick={fn} />
    
    <input type="text" ref={refInput}/>

    <SonA ref={refSon} ></SonA>
    </>
  )
}

